Skip to content

docs(usage): say how a first run waits for a very large compute pipeline - #15344

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
ycbuzi:docs/usage-long-first-compile
Nov 5, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
ycbuzi:docs/usage-long-first-compile

Conversation

@ycbuzi

@ycbuzi ycbuzi commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

What

Adds one paragraph to docs/user/USAGE.md under Shader cache: a first run can stop at a very large compute shader while the driver compiles its pipeline (no new frames, several CPU threads busy, minutes to hours for shaders of several million SPIR-V words), the two APS5_PROFILE_DRAW=1 log lines that name such a compile and its time, that the title's committed memory can keep growing meanwhile so the commit limit needs room (enlarge the page file on Windows), and that the finished pipeline comes from the driver's pipeline cache and the pipeline journal on later runs with the same GPU and driver.

Users who meet this see a frozen screen with nothing in the window, so they close the title or report a hang.

Tested

Docs only. What the paragraph says was seen on Windows 11, Ryzen 9 7900, RTX 4070 SUPER, NVIDIA driver 616.92, with Marvel's Spider-Man Remastered (PPSA01467). That build was main plus #14296 and local experiments, which is why these shaders were reached; the paragraph does not depend on them.

  • [dispatch] creating a pipeline for 4397537 SPIR-V words: the same capture replayed alone took 1,956,920 ms in vkCreateComputePipelines (32.6 minutes).
  • [dispatch] creating a pipeline for 6400735 SPIR-V words (program 0x1152cc9200) at 12:43: no created line after 292 minutes, the title stayed at 261 frames, and the process kept about 3 CPU threads busy. Closed by hand.
  • Committed memory of the title during that compile: 58.7 GB at 12:55, 73.9 GB at 15:58.
  • A 3,588,721-word pipeline that had taken 1,510.8 s was loaded in 182 ms on the next run with the same driver.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Hi ycbuzi,

The explanation of the long compile and the two log lines is useful. Could you soften the final sentence in the new paragraph in docs/user/USAGE.md?

The pipeline journal stores shader modules and pipeline inputs, then ReplayComputePipeline calls createComputePipeline again on background threads. It does not store the driver's finished pipeline. Whether this avoids the expensive compiler work depends on reuse from the driver's pipeline cache; keeping the same GPU and driver does not by itself guarantee that a later run never compiles it again.

For example: "Later runs can reuse the driver's pipeline cache; the pipeline journal rebuilds recorded pipelines in the background, which can avoid the wait when they are first reached. A driver update or another GPU starts a separate cache."

The rest of the paragraph can stay as written.

…ot that they always do

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ycbuzi

ycbuzi commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, softened the last sentence: later runs can reuse the driver's pipeline cache and the journal rebuilds recorded pipelines in the background, which can avoid the wait; neither guarantees the driver skips the compile, and a driver update or another GPU starts a separate cache.

🤖 Addressed by Claude Code

@github-actions github-actions Bot added the docs label Nov 3, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The docs-only update accurately separates a potentially faster replay from a guarantee that the driver will skip compilation, and the applicable hosted checks passed on head 7cc41503105a951babadef6aeb51d6cd41f96512.

What I ran

Reviewed all changed content at head 7cc41503105a951babadef6aeb51d6cd41f96512 against base 7feb37ee3e30e10139b483fb4df689d5b5b69ab8; the merge preview is clean. Environment: Debian Linux x86_64, Python 3.11.2, Git 2.39.5. No local build was applicable or run.

git diff --check 7feb37ee3e30e10139b483fb4df689d5b5b69ab8...7cc41503105a951babadef6aeb51d6cd41f96512
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15344
gh pr checks 15344 --repo boykopovar/AnyPS5
git show 7cc41503105a951babadef6aeb51d6cd41f96512:docs/user/USAGE.md
git show 7cc41503105a951babadef6aeb51d6cd41f96512:core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp

Results

Check Result Note
Diff and conventions passed No whitespace issues; repository conventions passed.
Documentation and source review passed The revised wording matches the journal replay implementation.
Hosted checks passed Conventions, labels and eligibility passed; build jobs were skipped for this docs-only change.
Optional test-quality helper failed Helper is absent from the isolated PR snapshot; no test files changed.
Build and local tests not applicable No code or test files changed.
Full precheck table and unedited helper output
Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check 7feb37ee3e30e10139b483fb4df689d5b5b69ab8...7cc41503105a951babadef6aeb51d6cd41f96512
conventions_and_pr_template passed /usr/bin/python3 tools/check_conventions.py --base 7feb37ee3e30e10139b483fb4df689d5b5b69ab8 --head 7cc41503105a951babadef6aeb51d6cd41f96512 --title docs(usage): say how a first run waits for a very large compute pipeline --body /tmp/anyps5-pr-precheck/15344-20261103/pr-body.md
changed_export_abi_audit not_applicable No changed source or public header under core/libs/prx.
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.
python_test_registration not_applicable No changed test_*.py files.
live_dependency_and_mergeability_check passed /usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 15344 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/15344-20261103/stack
build_dependent_cpp_tests not_applicable No C/C++ implementation or test files changed.
test_quality_heuristics failed /usr/bin/python3 /tmp/anyps5-pr-precheck/15344-20261103/head-7cc41503105a-6c4c3836/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/15344-20261103/head-7cc41503105a-6c4c3836 --json docs/user/USAGE.md
negative_controls not_applicable No changed Python test module in tools/ can be run as a no-build base-source control.
All conventions checks passed.
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/15344-20261103/head-7cc41503105a-6c4c3836/tools/pr_test_quality.py': [Errno 2] No such file or directory

Negative control

Not applicable: this change only edits documentation and has no executable assertion to disable.

Findings

Blocking

None.

Non-blocking

None. The author addressed the earlier concern by clarifying that cache/journal reuse can avoid a wait but does not guarantee the driver skips compilation.

Sources

Not verified

I did not reproduce the author's Windows 11/NVIDIA measurements or run a title, local build or runtime test. The performance observations in the PR description remain author-reported.

To get this to a good state

No changes are requested. If the head changes, I will rerun the diff check and precheck against the new head.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head 7cc4150 merged onto main 7feb37e · tested 2026-11-03 03:01 UTC · 13 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 1,058 passed · 4 failed (0 new, 3 also fail on main, 1 unstable on main) · 7 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 1,069 of 3,743 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (517 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ public_headers 82.1 s, ⚠️ agc_driver_image_sample_unnormalized 41.1 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 5 of the last 7 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_multisample_depth
Validation IDs already present on main (4 IDs in 441 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (441 tests): agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, agc_driver_bindless_images, and 433 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
Skipped (7)
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
Reproduce
git fetch origin 7cc41503105a951babadef6aeb51d6cd41f96512 7feb37ee3e30e10139b483fb4df689d5b5b69ab8
git checkout 7feb37ee3e30e10139b483fb4df689d5b5b69ab8 && git merge --no-ff 7cc41503105a951babadef6aeb51d6cd41f96512
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@oneandonlydean
oneandonlydean merged commit b355c59 into boykopovar:main Nov 5, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants